from mistralai import Mistral
import os

# 初始化 Mistral 客户端
s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

# 上传文件
res = s.files.upload(file={
    "file_name": "example.file",
    "content": open("example.file", "rb"),
})

# 处理响应
if res is not None:
    # handle response
    print(res)

